USB charger using current limit

ABSTRACT

A universal serial bus charger comprises a universal serial bus connector for providing a connection to a voltage source. An output voltage connector provides a charging voltage to a connected battery. A switching voltage regulator generates the charging voltage responsive to the voltage source. Control circuitry monitors an actual charging current applied to the connected battery and provides a programmed current signal enabling the actual charging current to operate at a programmed level if the actual charging current does not exceed a programmed charging current level. The control circuitry provides a charging current limit signal enabling the actual charging current to operate at a predetermined charge current limit if the actual charging current exceeds the programmed charging current level. PWM control circuitry generates switching control signals to control operation of the switching voltage regulator responsive to the control circuitry.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims benefit from U.S. Provisional Application No.61/058,371, filed Jun. 3, 2008 and entitled ADAPTIVE CURRENT LIMIT FORUSB CHARGER APPLICATIONS, which is incorporated herein by reference.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding, reference is now made to thefollowing description taken in conjunction with the accompanyingDrawings in which:

FIG. 1 is a block diagram of an electronic device with associatedbattery charger;

FIG. 2 is a general schematic diagram of a battery charger circuit andbattery;

FIG. 3 illustrates a typical USB current limiting scheme using dualsensing resistors;

FIG. 4 a illustrates an adaptive USB current limiting scheme;

FIG. 4 b illustrates an alternative embodiment of the adaptive USBcurrent limiting scheme;

FIG. 5 illustrates the circuitry for generating the limit current basedupon power balancing;

FIG. 6 illustrates the typical efficiency of a switching charger;

FIG. 7 is a flow diagram illustrating the operation of the circuitriesof FIGS. 3 and 4; and

FIG. 8 illustrates the typical charging curves using the sensor-lesscurrent limiting techniques of FIGS. 4 a, 4 b and 5.

DETAILED DESCRIPTION

Referring now to the drawings, wherein like reference numbers are usedherein to designate like elements throughout, the various views andembodiments of a USB charger using sensor-less current limits areillustrated and described, and other possible embodiments are described.The figures are not necessarily drawn to scale, and in some instancesthe drawings have been exaggerated and/or simplified in places forillustrative purposes only. One of ordinary skill in the art willappreciate the many possible applications and variations based on thefollowing examples of possible embodiments.

Since the universal serial bus specification provides a 5V power supply,it is possible to use a USB port as a power source for rechargingbatteries. Products based on this approach include chargers designed tocharge standard Li-ion cells, nickel metal hydride cells, and customnickel metal hydride batteries with built-in USB plugs. This type ofcircuitry eliminates the need for a 5V wall adapter.

USB interfaces had become more and more popular. Many handheldelectronic devices such as mobile phones, PDAs, MP3 players, digitalcameras, etc. have been designed to enable the battery to be chargedthrough its USB port. This type of charging utilizes a USB providedpower source to charge the battery. However, there are strict guidelinesthat must be met when utilizing a USB port to charge a battery. Onemajor restriction is that the maximum current that can be drawn from aUSB source is limited to 500 mA for a self powered port and 100 mA for abus powered port. A bus powered port is a port that obtains its powerfrom an upstream USB port.

Battery powered electronic devices are configured to be charged in anumber of different fashions. Since the maximum current that can bedrawn from a USB port is limited to 500 mA for self powered ports and100 mA for bus powered ports, the use of a switching charger may provebeneficial for charging the battery at a higher rate with limited inputcurrent to the charger as opposed to the use of a linear charger.

Within existing USB powered charging current configurations, a currentsensing resistor is needed on the input path from the voltage source tomonitor the input current to ensure that the charging current does notexceed the imposed charging current limits. Additionally, currentsensing is needed at the battery connection to regulate the chargingcurrent. The current sensing resistor on the input path causes powerloss within the charger circuitry and adds costs to the manufacture ofthe charging system. The input current sensor resistor is normallyintegrated in the charger IC using polysilicon resistors. The untrimmedtolerance of the poly resistors is normally quite large (typically20%-30%) due to process variations in manufacturing of the siliconwafer. To achieve greater accuracies the addition of trim circuitry isnecessary and this will require significant increases in the die areanecessary for the charger circuitry. Thus, some manner of overcomingthese problems is desired.

Referring now to the drawings, and more particularly to FIG. 1, there isillustrated a general block diagram of a battery charger and electronicdevice. A battery charger 102 is interconnected with an electronicdevice 104 having a battery associated therewith. Battery charger 102charges the associated electronic device 104 battery responsive to aprovided power source to the battery charger 102. This power sourcecould comprise an AC adaptor, an USB port or any other type of sourceable to provide a voltage source to the charger 102 for charging thebattery of the electronic device 104.

FIG. 2 is a general schematic diagram of charging circuitry 202. Theinput voltage V_(IN) from a power source is provide at an input node 202across a high side switching transistor 204 between nodes 202 and 206.The low side switching transistor 208 is connected between node 206 andground. Each of transistors 204 and 208 are controlled by PWM controlcircuitry 210. The PWM control circuitry 210 receives additional controlinputs from other sources as will be described herein below. An inductor212 is connected between nodes 206 and node 214. A load capacitor 216 isconnected between node 214 and ground. A current sensing resistor 220 isconnected between node 214 and 222. Finally, the battery 218 isconnected to the voltage output node V_(OUT) at node 222. The positiveterminal of the battery is connected to node 222 and the negativeterminal of the battery 218 is connected to ground.

FIG. 3 illustrates a schematic diagram of a typical USB current limitingscheme using an input current sensing poly resistor for charging abattery 302. The charging circuitry is connected at node 304 to a USBpower source. A capacitor 306 is connected between node 304 and ground.The charge current is provided through a poly resistor 308 that isincluded within the charging circuitry. The poly resistor 308 isconnected between nodes 310 and 312, and a switching transistor 314 isconnected between node 312 and node 316. An inductor 318 is connectedbetween node 316 and node 320. The charge current passes through acurrent sensing resistor 322 between node 320 and node 324. The positiveterminal of the battery is connected to node 324. A first capacitor 326is connected between node 320 and ground and a second capacitor 328 isconnected between node 324 and ground. The resistor 322 detects thecharge current being applied to the battery 302.

A non-inverting input of a current sense amplifier (CSA) 330 isconnected to node 320. The inverting input of the current senseamplifier is connected to node 324. The current sense amplifier 330generates the signal I_(CHG) at its output responsive to the voltagedrop across the current sensing resistor 322. The output of the currentsense amplifier 330 is provided to the inverting input of an erroramplifier 332. The non-inverting input of the error amplifier 332 isconnected to receive a reference signal I_(REF). The output of erroramplifier 332 comprises the difference between the I_(CHG) and I_(REF)signals and is provided to PWM control circuitry 334. The PWM controlcircuitry 334 responsive to the error amplifier signal generates controlsignals to switching transistors 314 and 336. Transistor 336 has itsdrain/source path connected between node 316 and ground. Thedrain/source path of transistor 314 is connected between node 312 andnode 316.

The I_(REF) is a reference signal for the charging current throughresistor 322. The current source 340 provides a bias current to theexternal resistor that sets the nominal charging current. The inputcurrent I_(IN) is measured through the poly resistor 308. Thenon-inverting input of the current sense amplifier 342 is connected tonode 310 while the inverting input of the current sense amplifier 342 isconnected to node 312 on the other side of the current sense resistor308. The output of the current sense amplifier 342 provides signalI_(IN) which is averaged at averaging circuitry 344 with previousinputs. The output of the averaging circuitry 344 is provided to thenegative input of a comparator 146. The positive input of the comparator346 is connected to a 500 mA reference current value. The output of thecomparator 346 is connected to the gain reduction circuit 348, and theoutput of the gain reduction circuit 348 is connected to a multipliercircuit 350 which multiplies the nominal charging reference signalI_(REF) with a reduction gain should the input current reach 500 mA. Ifthe input current is below 500 mA, no gain reduction is needed, i.e.I_(REF) will equal to the voltage at node 354. The voltage at node 354is programmed by a resistor R_(IREF) 352 connected between node 354 andground.

In order to improve upon the problems of excessive power loss to thesensing resistor 308 and increase in die area due to trimming circuitryassociated with the sensing resistor 308, the circuitry of FIG. 4 a maybe utilized to provide a charging circuitry with a sensor-less currentlimit scheme. In this embodiment, the USB input source is connected tonode 304. The capacitor 306 is connected between node 304 and ground.Rather than using a poly resistor to sense the input current, the inputcurrent is applied directly through switching transistor 314 to node316. Inductor 318 is connected between node 316 and node 320. Sensingresistor R_(SEN) 322 is connected between node 320 and node 324. Thepositive terminal of battery 302 is connected to node 324 and capacitors326 and 328 are connected to nodes 320 and 324 respectively. Accordingto the current disclosure, the battery 302 may comprise a single cellbattery for handheld devices but additionally may also apply to devicesthat operate using multiple battery cells (e.g. notebook/computer).

The current sensing amplifier 330 has its non-inverting input connectedto node 320 and its inverting input connected to node 324. This enablesthe current sense amplifier 330 to measure the output charging currentI_(CHG) passing through resistor R_(SEN) 322 and provide an indicationof this value at its output to node 402. The output of the current senseamplifier 330 is connected to the inverting input of an error amplifier332. The non-inverting input of amplifier 332 is connected to a switchmux 404 selecting either reference signal I_(REF) or I_(LIM), dependingon the charging current signal I_(CHG). The value of I_(REF) isprogrammable via the resistor 352. The other input of the switch 404 isconnected to a charge limit signal I_(LIM) which is provided by thecircuitry described in FIG. 5 which will be discussed herein below. Theoutput of the error amplifier 332 is provided as a control input to thePWM controller 334 which provides control signals to the gates oftransistors 314 and 336. The error amplifier 332 measures thedifferences in value between the charging signal I_(CHG) and either thesignal I_(REF) or I_(LIM) and provides this as a control signal to thePWM control circuitry 334 which allows the switching signal to drive thecharging current to substantially equal to a current associated withI_(REF) or I_(LIM).

The switch 404 which selects the signal I_(REF) or I_(CHG,LIM) isoperated responsive to the output of a comparator 406. Comparator 406compares the signal I_(CHG) to the signal I_(LIM) that is provided asdiscussed therein below to determine if the charging current hasexceeded the current limit. If the charging current signal I_(CHG) isgreater than the calculated I_(LIM), I_(LIM) is selected as a referencevalue to regulate the charging current; otherwise I_(REF) will beselected as the reference value. This will ensure that the chargerdelivers maximum current to the battery without exceeding the inputcurrent limit. The comparator 406 should have a hysteresis implementedwith in the circuit. When the current rises to reach ILIM, thecomparator output toggles and changes the output of switch 404. Oncethis happens, the inverting input has to be lower than the non-invertinginput by certain amount to allow toggling of the comparator outputagain. This prevents chatter in the comparator 406 when the chargingsignal I_(CHG) is equal to the limit current signal I_(CHG,LIM).

FIG. 4 b illustrates an alternative preferred embodiment of thecircuitry described with respect to FIG. 4 a. The circuitry remains thesame as that described with respect to FIG. 4 a except that theinverting input of the comparator 406, rather than being connected tothe output of the current sense amplifier 330 is connected to receivethe reference signal I_(REF). This voltage signal is the same as theI_(REF) signal applied to the input of switch 404.

Referring now to FIG. 5, there is illustrated the circuitry forgenerating the current limit signal I_(LIM). Previously discussedcomponents and nodes of FIG. 4 a are illustrated with the same referencenumbers within FIG. 5. The switching charger controller 500 includes thePWM controller 334, error amplifier 332, switch mux 404, comparator 406and current source 340 described previously with respect to FIG. 4. TheI_(LIM) signal provided to the positive input of comparator 406 and tothe switch 404 is generated at node 502 at the output of operationalamplifier 504.

The operational amplifier 504 has its inverting input connected toground and its non-inverting input connected to node 506. The input node506 is also connected to the output of an analog multiplier 308. Theoutput of the operation amplifier 504 is connected to one input of theanalog multiplier 508 at node 502. The other input of the analogmultiplier 508 is connected to the battery voltage V_(BAT) at node 324,through resistor divider 512 and 514. Node 510 is connected to theV_(BAT) pin through a voltage divider circuit consisting of resistors512 and 514. The non-inverting input of the amplifier 504 is alsoconnected at node 506 to a voltage divider circuit consisting ofresistors 516 and 518. Resistor 516 is connected between node 506 andground. Resistor 518 is connected between node 506 and node 520 which isconnected to the input voltage pin V_(IN) for receiving the chargingsource voltage. The end-of-charge current is programmed via a resistorR_(IMIN) 522 that is connected to the I_(MIN) pin of the device.

The sensor-less current limit scheme illustrated in FIGS. 4 a, 4 b and 5is based on the principal of energy conservation, i.e. the input powerprovided at the input node 304 equals the output power provided at pinV_(BAT) plus the power loss of the charger during the power conversion.The current limit I_(CHG,LIM) is calculated in the circuit shown in FIG.3 according to the equation:

${I_{{CHG},{LIM}} = \frac{\eta \times V_{IN} \times I_{{IN},{LIM}}}{V_{BAT}}};$where I_(CHG,LIM) is the maximum current that can charge a battery;I_(IN,LIM) is the input current limit, which is either 500 mA or 100 mAdepending on the USB port type; η is the efficiency of the powerconversion; V_(IN) and V_(BAT) are the input voltage and batteryvoltage, respectively.

To implement this equation, an analog divider 509 is required. Theanalog divider 509 is implemented by the configuration of the analogmultiplier 508 as illustrated in FIG. 5. In analog design, to implementthe equation A=B/C (where B and C are inputs, and A is an output) weimplement the circuit for B=A×C by connecting the output to A. This iswhat is done in the configuration of the analog multiplier 508 and ofamplifier 504 of FIG. 5. These circuits are connected to provide theI_(LIM) signal according to the equation:

$I_{LIM} = {\frac{V_{IN}}{V_{BAT}} \times 0.5{\eta.}}$

The efficiency η of a switching regulator, although not constant ingeneral, is relatively flat when the output current is sufficientlylarge. In the present case, the current limit is only in effect when theoutput current is greater than 100 mA. Thus, the effective range for theequation is in a range of 100 mA to 800 mA. Over this range, theefficiency is greater than 90% and is reasonably constant as isillustrated in FIG. 6. In FIG. 6 the efficiency illustrated generally bythe line 602 ranges from approximately 92%-95% over the range from 100mA to 800 mA. To provide an adequate safety margin 0.9 is used for η theefficiency of the power conversion.

In the sensor-less current limit scheme, if the actual charge current issmaller than the calculated current limit I_(CHG,LIM), no adjustment isneeded to the provided charging current, and the charger can continue tocharge the battery at the current set by the resistor R_(IREF) 352.However, when the actual charging current is greater than the currentlimit I_(CHG, LIM), the calculated current limit will then take effectbecoming the new reference charging current of the charging circuitry byactivating the switch mux 404 to provide the right current limitI_(LIM).

This process is more fully illustrated in flow chart in FIG. 7.Initially, the programmed charge current I_(CHG) is provided to thebattery at step 702. The programmed charge current is establishedresponsive to the programmed resistor R_(IREF). Next, at step 704 themaximum charging current limit is been determined based upon powerbalancing techniques according to the equation for I_(CHG,LIM). Thecurrent sense amplifier 330 monitors at step 706 the actual chargingcurrent I_(CHG) being provided to the battery 302. At inquiry step 708,a determination is made if the actual current I_(CHG) is greater thanthe programmed limit current I_(LIM) using the comparator 406. If not,the switch 404 continues to provide the signal I_(REF) and thus, theprogrammed charge current at step 710. If inquiry step 708 determinesthat the actual charging current has exceeded the programmed chargingcurrent limit, the comparator 406 causes switch mux 404 to provide thesignal I_(CHG, LIM), and thus switch to the maximum allowable chargingcurrent limit at step 712. After step 710, the circuit will provideswitching control using the PWM control circuit 334 to generate thecharging current to the battery at step 714 according to the programcharge current. Control passes back to step 706 to monitor the chargingcurrent. After step 712, the circuit will provide the switching controlusing the PWM control circuit 334 to generate the charging current tothe battery at step 716 according to the maximum charge current. Next,at step 718, the current is again monitored and inquiry step 720determines whether the actual charging current is now less than thecharging current limit. If not, the circuit continues to provide themaximum charging current at step 724 and control passes back to step 718to monitor the charging current. When the actual charging current isless than the charging current limit as determined at inquiry step 720,the circuitry switches back to the program charge current at step 722.Control then returns to step 710.

Using the sensor-less current limit scheme for charging a battery, thecharging curves illustrated in FIG. 8 may be achieved. Line 802comprises the battery charging voltage V_(BAT). The line 804 shows theassociated charging current I_(CHG) associated with the battery chargingvoltage V_(BAT). The input current limit is set to 500 mA, and theefficiency value used in the calculation is 0.9 as discussed hereinabove. The average constant current in the illustrated case isapproximately 600 mA. Using the above described configuration, no inputsensing current is needed for operating the charger. This enables themonitoring of the input current without the need for a current sensingpoly resistor. It is based on the fact that the input power equalsoutput power loss during the conversion. The charging current limit is agap of the adjusted to deliver the maximum current to the batterywithout exceeding the input current limit.

It will be appreciated by those skilled in the art having the benefit ofthis disclosure that this USB charger using sensor-less current limitprovides an improved battery charging device. It should be understoodthat the drawings and detailed description herein are to be regarded inan illustrative rather than a restrictive manner, and are not intendedto be limiting to the particular forms and examples disclosed. On thecontrary, included are any further modifications, changes,rearrangements, substitutions, alternatives, design choices, andembodiments apparent to those of ordinary skill in the art, withoutdeparting from the spirit and scope hereof, as defined by the followingclaims. Thus, it is intended that the following claims be interpreted toembrace all such further modifications, changes, rearrangements,substitutions, alternatives, design choices, and embodiments.

What is claimed is:
 1. A universal serial bus charger, comprising: auniversal serial bus connector for providing a connection to a voltagesource; an output voltage connector for providing a charging voltage toa connected battery; a switching voltage regulator for generating thecharging voltage responsive to the voltage source and PWM switchingcontrol signals, wherein the switching voltage regulator includes aplurality of switching transistors, and at least one switchingtransistor of the plurality of switching transistors is connecteddirectly to the universal serial bus connection; analog controlcircuitry for monitoring an actual charging current applied to theconnected battery and generating a reference charge level signal at anon-zero level, the analog control circuitry determining a differencebetween the actual charging current and the reference charge levelsignal, the analog control circuitry including a comparator forcomparing the actual charging current with a charging current limitlevel and determining if the actual charging current exceeds thecharging current limit level, and responsive to the determining, theanalog control circuitry generating the reference charge level signal ata first value if the actual charging current does not exceed thecharging current limit level and generating the reference charge levelsignal at a second value if the actual charging current exceeds thecharging current limit level, the second value associated with thecharging current limit level, wherein the analog control circuitryincludes an analog divider circuit for receiving an input voltage fromthe voltage source, a battery voltage of the connected battery, and acurrent limit value associated with the voltage source, and generatingthe charging current limit level as an analog signal based on the inputvoltage from the voltage source, the battery voltage of the connectedbattery, the current limit value associated with the voltage source, anda predetermined efficiency value associated with a power conversion ofthe switching voltage regulator; and a PWM control circuit forgenerating the PWM switching control signals to control operation of theswitching voltage regulator responsive to the difference between theactual charging current and the reference charge level signal at thefirst value when the charging current does not exceed the chargingcurrent limit level and responsive to the difference between the actualcharging current and the reference charge level signal at the secondvalue when the charging current exceeds the charging current limitlevel.
 2. The universal serial bus charger of claim 1, wherein theanalog control circuitry further includes: a current source forproviding a fixed current; a resistor having a user selected value; andwherein the first value for the reference charge level signal isgenerated responsive to the current source and the resistor.
 3. Theuniversal serial bus charger of claim 1, wherein the analog controlcircuitry further comprises: the comparator for determining if themonitored actual charging current exceeds the charging current limitlevel and generating a switching output responsive thereto; a switchconnected to receive the first value for the reference charge levelsignal and the second value of the reference charge level signalresponsive to the switching output of the comparator.
 4. The universalserial bus charger of claim 1, wherein the analog control circuitryfurther comprises an error amplifier for providing the differencebetween the actual charging current and the reference charge levelsignal to the PWM control circuit.
 5. The universal serial bus chargerof claim 1, wherein the analog control circuitry further comprises: aresistor connected in series with the connected battery; and a currentsense amplifier connected across the resistor for generating anindication of the actual charging current.
 6. An apparatus, comprising:an electronic device including a universal serial bus connection forconnection to a voltage source; a battery charger for charging aconnected battery responsive to the voltage source, said battery chargercomprising: an output voltage connector for providing a charging voltageto a connected battery; a switching voltage regulator for generating thecharging voltage responsive to the voltage source and PWM switchingcontrol signals, wherein the switching voltage regulator includes aplurality of switching transistors, and at least one switchingtransistor of the plurality of switching transistors is connecteddirectly to the universal serial bus connection; and analog controlcircuitry for monitoring an actual charging current applied to theconnected battery and generating a reference charge level signal at anon-zero level, the analog control circuitry determining a differencebetween the actual charging current and the reference charge levelsignal, the analog control circuitry including a comparator forcomparing the actual charging current with a charging current limitlevel and determining if the actual charging current exceeds thecharging current limit level, and responsive to the determining, theanalog control circuitry generating the reference charge level signal ata first predetermined value if the actual charging current does notexceed the charging current limit level and generating the referencecharge level signal at a second predetermined value if the actualcharging current exceeds the charging current limit level, the secondvalue associated with the charging current limit level, wherein theanalog control circuitry includes an analog divider circuit forreceiving an input voltage from the voltage source, a battery voltage ofthe connected battery, and a current limit value associated with thevoltage source, and generating the charging current limit level as ananalog signal based on the input voltage from the voltage source, thebattery voltage of the connected battery, the current limit valueassociated with the voltage source, and a predetermined efficiency valueassociated with a power conversion of the switching voltage regulator;and a PWM control circuit for generating the PWM switching controlsignals to control operation of the switching voltage regulatorresponsive to the difference between the actual charging current and thereference charge level signal at the first predetermined value when thecharging current does not exceed the charging current limit level andresponsive to the difference between the actual charging current and thereference charge level signal at the second predetermined value when thecharging current exceeds the charging current limit level.
 7. Theapparatus of claim 6, wherein the analog control circuitry furtherincludes: a current source for providing a fixed current; a resistorhaving a user selected value; and wherein the first value for thereference charge level signal is generated responsive to the currentsource and the resistor.
 8. The apparatus of claim 6, wherein the analogcontrol circuitry further comprises: the comparator for determining ifthe monitored actual charging current exceeds the charging current limitlevel and generating a switching output responsive thereto; and a switchconnected to receive the first value for the reference charge levelsignal and the second value of the reference charge level signalresponsive to the switching output of the comparator.
 9. The apparatusof claim 6, wherein the analog control circuitry further comprises anerror amplifier for providing the difference between the actual chargingcurrent and the reference charge level signal to the PWM controlcircuit.
 10. The apparatus of claim 6, wherein the analog controlcircuitry further comprises: a resistor connected in series with theconnected battery; and a current sense amplifier connected across theresistor for generating an indication of the actual charging current.11. A method for charging a battery through a universal serial busconnection, comprising the steps of: providing a direct connection froma voltage source through the universal serial bus connection and to atleast one switching transistor of a voltage regulator; generating acharging voltage responsive to the voltage source; providing thecharging voltage to a connected battery; monitoring an actual chargingcurrent applied to the connected battery analog control circuitry for;an analog divider circuit receiving an input voltage from the voltagesource, a battery voltage of the connected battery, and an analogcurrent limit level associated with the voltage source, and generatingan analog predetermined charging current limit level signal based on theinput voltage from the voltage source, the battery voltage of theconnected battery, the analog current limit value associated with thevoltage source, and a predetermined efficiency value associated with aconversion of power between the universal serial bus connection and theconnected battery; comparing the actual charging current with the analogpredetermined charging current limit level signal and determining if theactual charging current exceeds the analog predetermined chargingcurrent limit level signal; charging the battery using an analogreference charge level signal having a first value if the actualcharging current does not exceed the analog predetermined chargingcurrent limit level signal; and charging the battery using the referencecharge level signal having a second value if the actual charging currentexceeds the analog predetermined charging current limit level signal,the second value associated with the analog predetermined chargingcurrent limit level signal.
 12. The method of claim 11, wherein the stepof charging the battery using a reference charge level signal having afirst value further comprises the step of generating the actual chargingcurrent responsive to an input voltage provided by the voltage source,the monitored actual charging current, the analog predetermined chargingcurrent limit level signal and the reference charge level signal at thefirst value.
 13. The method of claim 11, wherein the step of chargingthe battery using the reference charge level signal having the firstvalue level further includes the steps of generating the referencecharge level signal at the first value responsive to a fixed currentsource and a user selected resistance.
 14. The method of claim 11,further including switching between the reference charge level signal atthe first value and the second value responsive to the determination ofif the actual charge current exceeds the analog predetermined chargingcurrent limit level signal.
 15. The method of claim 11, wherein the stepof charging further comprises the steps of: generating a differencebetween the actual charging current and the reference charge levelsignal; and controlling generation of the actual charging currentresponsive to the difference between the actual charging current and thereference charge level signal and the voltage source.
 16. The method ofclaim 11, wherein the monitoring further comprises measuring a currentthrough a current sense resistor.
 17. A battery charger circuit forcharging a battery from a universal serial bus (USB) port providing aninput voltage, comprising: a switching regulator configured to chargethe battery with a charging current, wherein the switching voltageregulator includes a plurality of switching transistors, and at leastone switching transistor of the plurality of switching transistors isconnected directly to the universal serial bus connection; and an analogcontroller coupled to the switching regulator, the analog controllerincluding: analog divider circuitry configured to receive the inputvoltage, a battery voltage, and a current limit value associated withthe USB port, and generate an analog charge current limit signal basedon the input voltage, the battery voltage, the current limit valueassociated with the USB port, and a predetermined efficiency valueassociated with a power conversion of the switching regulator; acomparator for monitoring an analog signal representing the chargingcurrent, comparing the charging current with the analog charge currentlimit signal, determining if the charging current exceeds the analogcharge current limit signal, and generating a switching outputresponsive thereto; and error amplifier and switching circuitryconfigured to generate an analog charge current target reference signaland a PWM control signal for the switching regulator responsive to theswitching output and based on a difference between the analog signalrepresenting the charging current and a current reference signal,wherein a value of the current reference signal is the lower value ofthe analog charge current target reference signal or the analog chargecurrent limit signal.
 18. The battery charger circuit of claim 17,wherein the analog controller comprises a PWM controller, an erroramplifier coupled to an input of the PWM controller, a switchingmultiplexer coupled to an input of the error amplifier, a comparatorcoupled to a control input of the switching multiplexer, the analogcharge current target reference signal coupled to a first input of theswitching multiplexer, and the analog charge current limit signalcoupled to a second input of the switching multiplexer.
 19. The batterycharger circuit of claim 17, wherein the switching regulator comprises:an operational amplifier coupled to the input voltage, an input of aswitching multiplexer, and an input of an analog multiplier; and acurrent sense amplifier coupled to an output of the battery, a batterycurrent sensing resistor, and an input of the switching multiplexer.